package com.mdd.front.validate.order;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 地址创建验证
 * @author shenjian
 * @createTime 2023年02月05日 23:44:00
 */
@Data
public class AddressUpdateValidate implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    /** 大厦ID */
    @NotNull(message = "请选择大厦")
    private Integer mansionId;

    /** 楼层 */
    @NotNull(message = "请填写楼层")
    private Integer floor;

    /** 门牌号 */
    @NotBlank(message = "请填写门牌号")
    @Length(min = 1, max = 30, message = "门牌号必须在1~30个字符内")
    private String houseNumber;

    /** 公司名称 */
    @NotBlank(message = "请填写公司名称")
    @Length(min = 1, max = 30, message = "公司名称必须在1~30个字符内")
    private String companyName;

    /** 昵称 */
    @NotBlank(message = "请填写昵称")
    @Length(min = 1, max = 30, message = "昵称必须在1~30个字符内")
    private String nickName;

    /** 手机号 */
    @NotNull(message = "mobile参数缺失")
    @NotEmpty(message = "手机号不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String mobile;

    /** 是否默认;1=是, 0=否 */
    private Integer isDefault = 0;
}
